{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5db9b7fb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入正确的账号：yuanzhifeng\n",
      "请输入正确的密码：dashuaige\n",
      "您的账号或密码不正确，请重新输入，您还有 2 次机会\n",
      "请输入正确的账号：yuanzhifeng\n",
      "请输入正确的密码：dashabi\n",
      "登陆成功，欢迎使用\n"
     ]
    }
   ],
   "source": [
    "goods_list = ['phone','computer','bag','food']\n",
    "user_data = \"yuanzhifeng\"\n",
    "user_password = \"dashabi\"\n",
    "count = 3\n",
    "while True:\n",
    "    username = input(\"请输入正确的账号：\")\n",
    "    password = input(\"请输入正确的密码：\")\n",
    "    count -=1\n",
    "    \n",
    "    if username == user_data:\n",
    "        if password == user_password:\n",
    "            print(\"登陆成功，欢迎使用\")\n",
    "            \n",
    "            \n",
    "            \n",
    "            \n",
    "            break\n",
    "        else:\n",
    "            if count == 0 :\n",
    "                print(\"您的账号被锁定，请五分钟后再尝试\")\n",
    "                break\n",
    "            else:\n",
    "                print(\"您的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")\n",
    "        \n",
    "    else:\n",
    "            if count == 0 :\n",
    "                print(\"您的账号被锁定，请五分钟后再尝试\")\n",
    "                break\n",
    "            else:\n",
    "                print(\"您的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "80064216",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
